package com.tihi.handsuiviewer;

import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Toast;

/**
 * 退出app的toast
 * 
 * @author duantihi
 * 
 * @date 2016-2-22 下午5:24:18
 */
public class ToastExitHelper {
	private Toast toast;

	public ToastExitHelper() {
		init();
	}

	private void init() {
		View layout = LayoutInflater.from(App.instance()).inflate(
				R.layout.exit_toast_view, null);
		toast = new Toast(App.instance());
		toast.setGravity(Gravity.LEFT | Gravity.BOTTOM
				| Gravity.FILL_HORIZONTAL, 0, 0);
		toast.setDuration(Toast.LENGTH_LONG);
		toast.setView(layout);
	}

	public void show() {
		toast.show();
	}

	public void cancel() {
		toast.cancel();
	}

}
